package com.ymatou.iapi.productmanager.service;

import java.util.List;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.prodstock.parameter.FreezeProductResult;
import com.ymatou.iapi.productmanager.parameter.packageInfo.CatalogPackageInfoDto;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;

public class GetPackageInfoByCatalogIdListCall extends YmatouAutoTestCall{
	private static String opurl ="api/SellerProduct/GetPackageInfoByCatalogIdList";
	
	public GetPackageInfoByCatalogIdListCall() {
		super(EnvSetup.getSystemUrl("productmanager"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Content-Type", "application/json");
	}
	
	public List<CatalogPackageInfoDto> GetProductPackageList(){
		String ProductPackageList = getJsonObject().get("Data").getAsJsonObject().get("ProductPackageList").getAsJsonArray().toString();
		List<CatalogPackageInfoDto> CatalogPackageInfoDtoList = (List<CatalogPackageInfoDto>)FormatUtil.GSONToObject(ProductPackageList, new TypeToken<List<CatalogPackageInfoDto>>(){}.getType());
		return CatalogPackageInfoDtoList;
	}
	
	public static void main(String[] args) {
		new GetPackageInfoByCatalogIdListCall().callAndGetReturnData();
	}
}
